using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Workflow2211A.Application.DTO.Inputs.IndependentBilling;
using Workflow2211A.Application.DTO.Outputs.IndependentBilling;
using Workflow2211A.Domain.IndependentBilling.DrugCategory;
using Workflow2211A.Domain.IndependentBilling.CheckupItem;
using Workflow2211A.Domain.IndependentBilling.PrescriptionApplication;
using Workflow2211A.Domain.IndependentBilling.TestItem;
using Workflow2211A.Domain;

namespace Workflow2211A.Application.Mappings
{
    /// <summary>
    /// 独立开单的AutoMapper配置文件
    /// </summary>
    public class IndependentBillingProfile : Profile
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public IndependentBillingProfile()
        {
            // 开单申请
            CreateMap<PrescriptionApplicationDTO, PrescriptionApplicationModel>()
                .ForMember(dest => dest.ApplicationTime, opt => opt.MapFrom(_ => DateTime.Now))
                .ForMember(dest => dest.Status, opt => opt.MapFrom(_ => 0))
                .ForMember(dest => dest.Total, opt => opt.Ignore()) // 在代码中计算总价
                .ForMember(dest => dest.ExaminationItemId, opt => opt.Ignore())
                .ForMember(dest => dest.TestItemId, opt => opt.Ignore())
                .ForMember(dest => dest.MedicineId, opt => opt.Ignore())
                .ForMember(dest => dest.DeliveryTime, opt => opt.Ignore())
                .ForMember(dest => dest.CancelTime, opt => opt.Ignore())
                .ForMember(dest => dest.Quantity, opt => opt.Ignore());
        }
    }
} 